<?php 
namespace Home\Controller;
use Think\Controller;

class GoodsController extends Controller{

	public function checkout(){
		$number2 = I('post.number');
		$goods_id = I('goods_id');
		session('[start]');
		$kz = 0;

		foreach($_SESSION['charge'] as $kv){
			if($kv == $goods_id){	
				$kz = 1;
			}
		}
		if($kz != 1){
			$_SESSION['charge'][] = $goods_id;
		}
		$goodsModel = D('Admin/goods');
		$map['goods_id'] = array('in',$_SESSION['charge']);
		$goods_values = $goodsModel->where($map)->select();
		//var_dump($goods_values);exit;
		$this->assign('gvw',$goods_values);
		$this->display();
	}

	public function goods(){
		$goods_id = I('goods_id');
		$goodsModel = D('Admin/goods');
		$goods_values = $goodsModel->where("goods_id = $goods_id")->select();
		$this->assign('gv',$goods_values);
		$this->display();
	}
}



?>